package com.api.demo.dto.business.company;

import com.api.demo.dto.business.ApiDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @description: 线下充值DTO
 * @author: yanming
 * @createDate: 2022/12/27 10:30
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class OfflineRechargeDTO extends ApiDTO {

    private static final long serialVersionUID = -5762990495642805325L;
    @ApiModelProperty(value = "社会信用代码", required = true)
    @NotBlank(message = "社会信用代码不能为空")
    private String creditCode;

    @ApiModelProperty(value = "服务商id", required = true)
    @NotNull(message = "服务商不能为空")
    private Long taxId;


    @NotNull(message = "充值金额不能为空")
    @Range(max = 99999999, message = "金额错误")
    @ApiModelProperty(value = "充值金额", required = true)
    @Min(value = 0, message = "充值金额不能为0")
    private BigDecimal money;


    @ApiModelProperty(value = "充值凭证", required = true)
    @NotNull(message = "充值凭证不能为空")
    @URL(message = "请传入正确的链接")
    private String payReceiptUrl;
}